home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / QuickTime / QuickTime 3 Interfaces & Libs / QTDevWin / CIncludes / ENET.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-21  |  4.5 KB  |  169 lines  |  [TEXT/dosa]

  1. /*
  2.      File:        ENET.h
  3.  
  4.      Contains:    Ethernet Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    QuickTime 3.0
  8.  
  9.      Copyright:    © 1990-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __ENET__
  19. #define __ENET__
  20.  
  21. #ifndef __MACTYPES__
  22. #include <MacTypes.h>
  23. #endif
  24. #ifndef __OSUTILS__
  25. #include <OSUtils.h>
  26. #endif
  27.  
  28.  
  29.  
  30. #if PRAGMA_ONCE
  31. #pragma once
  32. #endif
  33.  
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37.  
  38. #if PRAGMA_IMPORT
  39. #pragma import on
  40. #endif
  41.  
  42. #if PRAGMA_STRUCT_ALIGN
  43.     #pragma options align=mac68k
  44. #elif PRAGMA_STRUCT_PACKPUSH
  45.     #pragma pack(push, 2)
  46. #elif PRAGMA_STRUCT_PACK
  47.     #pragma pack(2)
  48. #endif
  49.  
  50.  
  51. enum {
  52.     ENetSetGeneral                = 253,                            /*Set "general" mode*/
  53.     ENetGetInfo                    = 252,                            /*Get info*/
  54.     ENetRdCancel                = 251,                            /*Cancel read*/
  55.     ENetRead                    = 250,                            /*Read*/
  56.     ENetWrite                    = 249,                            /*Write*/
  57.     ENetDetachPH                = 248,                            /*Detach protocol handler*/
  58.     ENetAttachPH                = 247,                            /*Attach protocol handler*/
  59.     ENetAddMulti                = 246,                            /*Add a multicast address*/
  60.     ENetDelMulti                = 245                            /*Delete a multicast address*/
  61. };
  62.  
  63.  
  64. enum {
  65.     EAddrRType                    = FOUR_CHAR_CODE('eadr')        /*Alternate address resource type*/
  66. };
  67.  
  68. typedef struct EParamBlock                 EParamBlock;
  69. typedef EParamBlock *                    EParamBlkPtr;
  70. typedef CALLBACK_API( void , ENETCompletionProcPtr )(EParamBlkPtr thePBPtr);
  71. /*
  72.     WARNING: ENETCompletionProcPtr uses register based parameters under classic 68k
  73.              and cannot be written in a high-level language without 
  74.              the help of mixed mode or assembly glue.
  75. */
  76. typedef REGISTER_UPP_TYPE(ENETCompletionProcPtr)                 ENETCompletionUPP;
  77.  
  78. struct EParamBlock {
  79.     QElem *                            qLink;                        /*General EParams*/
  80.     short                             qType;                        /*queue type*/
  81.     short                             ioTrap;                        /*routine trap*/
  82.     Ptr                             ioCmdAddr;                    /*routine address*/
  83.     ENETCompletionUPP                 ioCompletion;                /*completion routine*/
  84.     OSErr                             ioResult;                    /*result code*/
  85.     StringPtr                         ioNamePtr;                    /*->filename*/
  86.     short                             ioVRefNum;                    /*volume reference or drive number*/
  87.     short                             ioRefNum;                    /*driver reference number*/
  88.     short                             csCode;                        /*Call command code*/
  89.     union {
  90.         struct {
  91.             short                             eProtType;            /*Ethernet protocol type*/
  92.             Ptr                             ePointer;            /*No support for PowerPC code*/
  93.             short                             eBuffSize;            /*buffer size*/
  94.             short                             eDataSize;            /*number of bytes read*/
  95.         }                                 EParms1;
  96.         struct {
  97.             Byte                             eMultiAddr[6];        /*Multicast Address*/
  98.         }                                 EParms2;
  99.     }                                 u;
  100. };
  101.  
  102. enum { uppENETCompletionProcInfo = 0x00009802 };                 /* register no_return_value Func(4_bytes:A0) */
  103. #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  104.     #pragma parameter CallENETCompletionProc(__A1, __A0)
  105.     void CallENETCompletionProc(ENETCompletionUPP routine, EParamBlkPtr thePBPtr) = 0x4E91;
  106. #else
  107.     #define CallENETCompletionProc(userRoutine, thePBPtr)         CALL_ONE_PARAMETER_UPP((userRoutine), uppENETCompletionProcInfo, (thePBPtr))
  108. #endif
  109. #define NewENETCompletionProc(userRoutine)                         (ENETCompletionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppENETCompletionProcInfo, GetCurrentArchitecture())
  110. EXTERN_API( OSErr )
  111. EWrite                            (EParamBlkPtr             thePBptr,
  112.                                  Boolean                 async);
  113.  
  114. EXTERN_API( OSErr )
  115. EAttachPH                        (EParamBlkPtr             thePBptr,
  116.                                  Boolean                 async);
  117.  
  118. EXTERN_API( OSErr )
  119. EDetachPH                        (EParamBlkPtr             thePBptr,
  120.                                  Boolean                 async);
  121.  
  122. EXTERN_API( OSErr )
  123. ERead                            (EParamBlkPtr             thePBptr,
  124.                                  Boolean                 async);
  125.  
  126. EXTERN_API( OSErr )
  127. ERdCancel                        (EParamBlkPtr             thePBptr,
  128.                                  Boolean                 async);
  129.  
  130. EXTERN_API( OSErr )
  131. EGetInfo                        (EParamBlkPtr             thePBptr,
  132.                                  Boolean                 async);
  133.  
  134. EXTERN_API( OSErr )
  135. ESetGeneral                        (EParamBlkPtr             thePBptr,
  136.                                  Boolean                 async);
  137.  
  138. EXTERN_API( OSErr )
  139. EAddMulti                        (EParamBlkPtr             thePBptr,
  140.                                  Boolean                 async);
  141.  
  142. EXTERN_API( OSErr )
  143. EDelMulti                        (EParamBlkPtr             thePBptr,
  144.                                  Boolean                 async);
  145.  
  146.  
  147.  
  148.  
  149. #if PRAGMA_STRUCT_ALIGN
  150.     #pragma options align=reset
  151. #elif PRAGMA_STRUCT_PACKPUSH
  152.     #pragma pack(pop)
  153. #elif PRAGMA_STRUCT_PACK
  154.     #pragma pack()
  155. #endif
  156.  
  157. #ifdef PRAGMA_IMPORT_OFF
  158. #pragma import off
  159. #elif PRAGMA_IMPORT
  160. #pragma import reset
  161. #endif
  162.  
  163. #ifdef __cplusplus
  164. }
  165. #endif
  166.  
  167. #endif /* __ENET__ */
  168.  
  169.